package cc.autoapi.pucong.auto.flow.provider.api.controller;

import cc.autoapi.pucong.auto.flow.core.root.exception.AutoFlowBaseController;
import cc.autoapi.pucong.auto.flow.core.root.exception.AutoFlowExceptionHandler;
import cc.autoapi.pucong.auto.flow.core.root.utils.Res;
import cc.autoapi.pucong.auto.flow.provider.api.manager.ApiParamsManager;
import cc.autoapi.pucong.auto.flow.provider.api.entity.qo.ApiParamsQo;
import cc.autoapi.pucong.auto.flow.provider.api.entity.vo.ApiParamsVo;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author pucong
 * @description api参数信息 controller
 * @create 2024-09-24
 */
@RestController
@Validated
@RequestMapping("/api/apiParams")
public class ApiParamsController extends AutoFlowBaseController implements AutoFlowExceptionHandler{

    @Resource
    private ApiParamsManager apiParamsManager;

    @GetMapping("/getList")
    public Res<List<ApiParamsVo>> getList(ApiParamsQo dto) {
        List<ApiParamsVo> apiParamsList = apiParamsManager.getList(dto);
        return Res.ok(apiParamsList);
    }
}
